#ifndef _INTERF_CALL_H_
#define _INTERF_CALL_H_

enum E_Call_Progress{
	//
	e_idle,
	e_invite,
	e_ringing,
	e_early_media,
	e_connect,
	e_hangup
};


struct ICallSession
	: public IBase
{
	static ICallSessionPtr New(
		IUserPtr user
		, const e::String& callID
		, const e::String& callTo
		);

	virtual e::String getCallID() const = 0;
	virtual IUserPtr getUser() = 0;
	virtual e::String getCallTo() const = 0;
	virtual E_Call_Progress getState() const = 0;

	virtual void storeFrom(const AS_EventPtr& event) = 0;
	virtual void storeTo(const AS_EventPtr& event) = 0;

	virtual void Hangup(
		ump::spec::Actor actor
		, ump::spec::ResultReason r
		) = 0;

#ifdef _DEBUG
	virtual void RunTimmer() = 0;
#endif
};

struct ICallSessionCache
{
	static ICallSessionCachePtr New();

	virtual ICallSessionPtr get(const e::String& callID) = 0;
	virtual ICallSessionPtr set(
		const IUserPtr& user
		, const e::String& callID
		, const e::String& callTo
		) = 0;
	virtual ICallSessionPtr remove(const e::String& callID) = 0;
};

#endif